#include<stdio.h>
#include<stdlib.h>
#include"entete.h"
int rdtsc()
{
    __asm__ __volatile__("rdtsc");
}
int random(int max,int min)
{
    int x;
    srand(rdtsc());
    do
    {
                           x=(rand()%(max-min))+min;
    }
    while((x>5)&&(x<1));
    return(x);
}
void afficher_grille()
{
     system("color 3f");
     FILE *f;
     f=fopen("fichier.txt","r");
     if(f=NULL)
     {

         printf("impossible d'ouvrir le fichier");

     }
   else
   {


   }



     printf("\t\n\n\                 \xC9\xCD\xCD\xCD\xCD\xCD\xCB\xCD\xCD\xCD\xCD\xCD\xCB\xCD\xCD\xCD\xCD\xCD\xCB\xCD\xCD\xCD\xCD\xCD\xCB\xCD\xCD\xCD\xCD\xCD\xBB");
     printf("\n\t         \xBA %d   \xBA     \xBA     \xBA <   \xBA     \xBA\n",random(6,1));
     printf("\t         \xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xB9");
     printf("\n\t         \xBA     \xBA    <\xBA  %d  \xBA     \xBA     \xBA\n",random(6,1));
     printf("\t         \xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xB9");
     printf("\n\t         \xBA     \xBA     \xBA     \xBA %d   \xBA     \xBA\n",random(6,1));
     printf("\t         \xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xB9");
     printf("\n\t         \xBA     \xBA %d > \xBA     \xBA     \xBA     \xBA\n",random(6,1));
     printf("\t         \xCC\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xCE\xCD\xCD\xCD\xCD\xCD\xB9");
     printf("\n\t         \xBA     \xBA     \xBA  %d  \xBA     \xBA     \xBA\n",random(6,1),random(6,1));
     printf("\t         \xC8\xCD\xCD\xCD\xCD\xCD\xCA\xCD\xCD\xCD\xCD\xCD\xCA\xCD\xCD\xCD\xCD\xCD\xCA\xCD\xCD\xCD\xCD\xCD\xCA\xCD\xCD\xCD\xCD\xCD\xBC");

     getch();
}

void niveau_du_jeu()
{
                      printf("choisissez un nouveau\n\n\n");
                      printf("\t             \xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB");
                      printf("\n\t             \xBA  1    \xBA    FACILE  \xBA");
                      printf("\n\t             \xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xB9");
                      printf("\n\t             \xBA  2    \xBA    MOYEN   \xBA");
                      printf("\n\t             \xCC\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xB9");
                      printf("\n\t             \xBA  3    \xBA  DIFFICILE \xBA");
                      printf("\n\t             \xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC");
                      printf("\n\n\n            Taper F,M ou D");
                      getch();

}

void afficher_instruction(char fichier[])
{
    FILE *f;
    int rep;
    char n[100];
    f=fopen("D:\\instructions.txt","rb");
    if(f==NULL)
    printf("impossible d'ouvrir le fichier");
    else
    {
        rep=fread(&n,sizeof(n),1,f);
        do
        {
                                    printf(" %s ",n);

                                    rep=fread(&n,sizeof(n),1,f);
        }
        while(rep!=0);
    }

    fclose(f);
    getch();
}

